﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Temp.Controller;
using Temp.Model;
using Temp.NLG;
using Temp.Planner2;

namespace Temp.View
{
    class Peer
    {
        ContentManager Content;

        ExitController exCtr;
        NavigationController nCtr;
        PlaceController pCtr;

        private int curPlace;
        private Player alex;
        MouseState m, curM;
        Point mouse;

        List<Navigation> mainBlocks;            //lists are dependent on curWorld
        List<Navigation> blocks;
        List<Navigation> upSideBlocks;
        List<Navigation> rightSideBlocks;

        private List<Character> npcs;           //all npcs
        private List<Item> items;               //all items
        Point[] ptsAroundBlock;                 // 0-> pt. 1 .... 1-> pt. 2....2-> goal
        Point curPos;

        bool shift = false, change = true;        //shift for loading, change for checking
        bool walkAround = false;                //walk Around block    
        bool walkAroundRightBlock = false;
        bool walkAroundUp = false;
        public bool peerCanWalk { get; set; }
        bool isPeerInGoal = false;

        int curMainBlock, oldMainBlock;         //curMainBlock -> ung bgong ppnthan, oldMainBlock -> kng nsan main block si peer
        Exit exit;
        String exitDir; bool flip = false;

        Navigation curBlock;                    //the current block n kelangan iavoid ni peer
        Item curItem;                           //current item selected
        Character curChar;                      //current char selected

        DialogueView diaV;
        Describer describer;
        StoryPlanner sp;

        List<Item> listInventory;
        public bool invShowing { get; set; }
        private bool stop = false;
        int timer = 0;
        public Peer(int curPlace)
        {
            alex = new Player();
            alex.x = 564;
            alex.y = 360;
            exCtr = new ExitController();
            nCtr = new NavigationController();
            pCtr = new PlaceController();

            mainBlocks = new List<Navigation>();
            blocks = new List<Navigation>();
            upSideBlocks = new List<Navigation>();
            rightSideBlocks = new List<Navigation>();

            ptsAroundBlock = new Point[3];
            ptsAroundBlock[2].X = -1;           //it means there's no goal yet
            curMainBlock = 0;
            oldMainBlock = -1;
            this.curPlace = curPlace;
            shift = true; change = false;
            peerCanWalk = true;
            exitDir = "";
        }


        public void Initialize(List<Item> listInventory, DialogueView dv, StoryPlanner sp, AlexGame alexGame)
        {
            this.listInventory = listInventory;
            this.diaV = dv;
            this.sp = sp;
            this.describer = new Describer(sp);

        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="content"></param>
        /// <param name="gender">boy or girl?</param>
        public void LoadContent(ContentManager Content)
        {
            this.Content = Content;
        }
        public void LoadPeer(ContentManager Content, String gender)
        {
            Texture2D[] pic = new Texture2D[1];
            pic[0] = Content.Load<Texture2D>("Peer/" + gender + "/def/stand.png");

            alex.def = pic;
            pic = new Texture2D[4];

            pic[0] = Content.Load<Texture2D>("Peer/" + gender + "/Left/1.png");
            pic[1] = Content.Load<Texture2D>("Peer/" + gender + "/Left/2.png");
            pic[2] = Content.Load<Texture2D>("Peer/" + gender + "/Left/3.png");
            pic[3] = Content.Load<Texture2D>("Peer/" + gender + "/Left/4.png");

            alex.left = pic;
            pic = new Texture2D[4];

            pic[0] = Content.Load<Texture2D>("Peer/" + gender + "/Right/1.png");
            pic[1] = Content.Load<Texture2D>("Peer/" + gender + "/Right/2.png");
            pic[2] = Content.Load<Texture2D>("Peer/" + gender + "/Right/1.png");
            pic[3] = Content.Load<Texture2D>("Peer/" + gender + "/Right/3.png");
            alex.right = pic;
            pic = new Texture2D[4];

            pic[0] = Content.Load<Texture2D>("Peer/" + gender + "/Up/1.png");
            pic[1] = Content.Load<Texture2D>("Peer/" + gender + "/Up/2.png");
            pic[2] = Content.Load<Texture2D>("Peer/" + gender + "/Up/1.png");
            pic[3] = Content.Load<Texture2D>("Peer/" + gender + "/Up/2.png");

            alex.up = pic;
            pic = new Texture2D[4];

            pic[0] = Content.Load<Texture2D>("Peer/" + gender + "/Walk/1.png");
            pic[1] = Content.Load<Texture2D>("Peer/" + gender + "/Walk/2.png");
            pic[2] = Content.Load<Texture2D>("Peer/" + gender + "/Walk/1.png");
            pic[3] = Content.Load<Texture2D>("Peer/" + gender + "/Walk/2.png");

            alex.walk = pic;

            alex.setCur(4);
        }

        protected void processMouse()
        {

            if (m.LeftButton == ButtonState.Pressed)
            {
                curM = m;
                curPos = new Point(alex.x, alex.y);
            }

            int i = 0;
            foreach (Navigation nav in mainBlocks)
            {
                if ((alex.x >= nav.x && alex.x <= nav.x + nav.dimX && alex.y >= nav.y && alex.y <= nav.y + nav.dimY))
                {
                    oldMainBlock = i;
                    break;
                }
                i++;
            }

            /*
             * 
             * For avoiding blocks
             * 
             */
            if (!walkAround)
            {
                foreach (Navigation nav in blocks)
                {
                    if ((alex.x >= nav.x && alex.x <= nav.x + nav.dimX && alex.y >= nav.y && alex.y <= nav.y + nav.dimY))
                    {
                        if (alex.x >= curM.X)                      //nsa left sia
                        {
                            if (alex.y - nav.y <= nav.y + nav.dimY - alex.y)        //mas malapit si peer sa taas
                            {
                                ptsAroundBlock[0] = new Point(nav.x + nav.dimX, nav.y);
                                ptsAroundBlock[1] = new Point(nav.x, nav.y);
                                ptsAroundBlock[2].X = -1;
                                walkAround = true;
                            }
                            else
                            {
                                ptsAroundBlock[0] = new Point(nav.x + nav.dimX, nav.y + nav.dimY);
                                ptsAroundBlock[1] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[2].X = -1;
                                walkAround = true;
                            }
                        }
                        else if (alex.x < curM.X)                  //right
                        {
                            if (alex.y - nav.y <= nav.y + nav.dimY - alex.y)
                            {
                                ptsAroundBlock[0] = new Point(nav.x, nav.y);
                                ptsAroundBlock[1] = new Point(nav.x + nav.dimX, nav.y);
                                ptsAroundBlock[2].X = -1;
                                walkAround = true;
                            }
                            else
                            {
                                ptsAroundBlock[0] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[1] = new Point(nav.x + nav.dimX, nav.y + nav.dimY);
                                ptsAroundBlock[2].X = -1;
                                walkAround = true;
                            }
                        }
                        curBlock = nav;
                        break;
                    }
                }
            }

            if (!walkAroundRightBlock)
            {
                foreach (Navigation nav in rightSideBlocks)
                {
                    if ((alex.x >= nav.x && alex.x <= nav.x + nav.dimX && alex.y >= nav.y && alex.y <= nav.y + nav.dimY))
                    {
                        if (alex.x >= nav.x)                  //right
                        {
                            if (alex.y - nav.y <= nav.y + nav.dimY - alex.y)
                            {
                                ptsAroundBlock[0] = new Point(nav.x, nav.y);
                                ptsAroundBlock[1] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[2].X = -1;
                                walkAroundRightBlock = true;
                            }
                            else
                            {
                                ptsAroundBlock[0] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[1] = new Point(nav.x, nav.y);
                                ptsAroundBlock[2].X = -1;
                                walkAroundRightBlock = true;
                            }
                        }
                        //goRight = true;
                        curBlock = nav;
                        break;
                    }
                }
            }
            /*
             * 
             * Left Button Clicked
             * 
             */
            if (m.LeftButton == ButtonState.Pressed && !walkAround && !walkAroundUp && !walkAroundRightBlock)
            {
                foreach (Exit ex in exCtr.getExits(curPlace))
                {
                    if ((m.X >= ex.endX && m.X <= ex.endX + ex.dimX && m.Y >= ex.endY && m.Y <= ex.endY + ex.dimY))
                    {
                        mouse.X = ex.startX;
                        mouse.Y = ex.startY;
                        exit = ex;
                        Mouse.SetPosition(ex.startX, ex.startY);
                        curM = Mouse.GetState();
                        //if (walkAroundUp)
                        //{
                        //    ptsAroundBlock[2].X = ex.startX;
                        //    ptsAroundBlock[2].Y = ex.startY;
                        //}
                        //if (ex.direction.Equals("north"))
                        //    alex.setCur(1);
                        //if (ex.direction.Equals("south"))
                        //    alex.setCur(5);
                        //if (ex.direction.Equals("east"))
                        //    alex.setCur(3);
                        //if (ex.direction.Equals("west"))
                        //    alex.setCur(6); 
                    }
                }

                i = 0;
                foreach (Navigation nav in mainBlocks)
                {
                    if ((m.X >= nav.x && m.X <= nav.x + nav.dimX && m.Y >= nav.y && m.Y <= nav.y + nav.dimY))
                    {
                        mouse.X = m.X;
                        mouse.Y = m.Y;
                        curMainBlock = i;
                        break;
                    }
                    i++;
                }
                foreach (Navigation nav in blocks)
                {
                    if ((m.X >= nav.x && m.X <= nav.x + nav.dimX && m.Y >= nav.y && m.Y <= nav.y + nav.dimY))
                    {
                        if (m.X > nav.x + nav.dimX / 2)
                        {
                            mouse.X = nav.x + nav.dimX + 10;
                            if (m.Y > nav.y + nav.dimY / 2)
                                mouse.Y = nav.y + nav.dimY;
                            else
                                mouse.Y = nav.y;
                        }
                        else
                        {
                            mouse.X = nav.x - 10;
                            if (m.Y > nav.y + nav.dimY / 2)
                                mouse.Y = nav.y + nav.dimY;
                            else
                                mouse.Y = nav.y;
                        } break;
                    }
                }
                foreach (Character ch in npcs)
                {
                    if (ch.idPlace == curPlace)
                    {
                        if ((m.X >= ch.x && m.X <= ch.x + 54 && m.Y >= ch.y && m.Y <= ch.y + 87))
                        {
                            if (ch.alexX != 0)              //if npc does not have a designated pt 
                            {
                                mouse.X = ch.alexX;
                                mouse.Y = ch.alexY;
                            }
                            else
                            {
                                if (alex.x >= ch.x + 28)
                                {
                                    mouse.X = ch.x + 79;
                                    mouse.Y = ch.y + 43;
                                }
                                else
                                {
                                    mouse.X = ch.x - 30;
                                    mouse.Y = ch.y + 43;
                                }
                            }
                            curChar = ch;
                            break;
                        }
                    }
                }
                foreach (Item it in items)
                {
                    if (it.idPlace == curPlace)
                    {
                        if ((m.X >= it.x && m.X <= it.x + it.dimX && m.Y >= it.y && m.Y <= it.y + it.dimY))
                        {
                            if (it.alexX != 0)              //if npc does not have a designated pt 
                            {
                                mouse.X = it.alexX;
                                mouse.Y = it.alexY;

                            }
                            else
                            {
                                if (alex.x >= it.x + 28)
                                {
                                    mouse.X = it.x + 79;
                                    mouse.Y = it.y + 43;
                                }
                                else
                                {
                                    mouse.X = it.x - 30;
                                    mouse.Y = it.y + 43;
                                }

                            }
                            curItem = it;
                            break;
                        }
                    }
                }
                curM = m;
                curPos = new Point(alex.x, alex.y);

            }


            if (!walkAroundUp)
            {
                foreach (Navigation nav in upSideBlocks)
                {
                    if ((alex.x >= nav.x  && alex.x <= nav.x + nav.dimX && alex.y >= nav.y && alex.y <= nav.y + nav.dimY))
                    {
                        if (curPos.X >= curM.X)                      //nsa right si alex
                        {
                            if (curPos.X > nav.x + nav.dimX)        //mas malapit si peer sa taas
                            {
                                ptsAroundBlock[0] = new Point(nav.x + nav.dimX, nav.y + nav.dimY);
                                ptsAroundBlock[1] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[2].X = -1;
                                walkAroundUp = true;
                            }
                            else if (curPos.X < nav.x + nav.dimX && curPos.X > nav.x)
                            {
                                ptsAroundBlock[0] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[1] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[2].X = -1;
                                walkAroundUp = true;
                                curBlock = nav;
                                break;
                            }
                        }
                        else if (alex.x < curM.X)                  //left
                        {
                            if (curPos.X < nav.x)
                            {
                                ptsAroundBlock[0] = new Point(nav.x, nav.y + nav.dimY);
                                ptsAroundBlock[1] = new Point(nav.x + nav.dimX, nav.y + nav.dimY);
                                ptsAroundBlock[2].X = -1;
                                walkAroundUp = true;
                            }
                            else if (curPos.X < nav.x + nav.dimX && curPos.X > nav.x)
                            {
                                ptsAroundBlock[0] = new Point(nav.x + nav.dimX, nav.y + nav.dimY);
                                ptsAroundBlock[1] = new Point(nav.x + nav.dimX, nav.y + nav.dimY);
                                ptsAroundBlock[2].X = -1;
                                walkAroundUp = true;
                            }
                        }

                        curBlock = nav;
                        break;
                    }
                }
            }
            if (exit != null)
            {
                if ((alex.x - 5 <= exit.startX && alex.y - 5 <= exit.startY) &&
                    (alex.x + 5 > exit.startX && alex.y + 5 > exit.startY))
                {

                    alex.setCur(4);
                    curPlace = pCtr.getNextPlace(curPlace, exit.direction);

                    exitDir = exit.direction;
                    curMainBlock = 0;
                    oldMainBlock = -1;

                    Exit startEx = exCtr.getExit(curPlace, exit.direction);

                    mouse.X = startEx.startX;
                    mouse.Y = startEx.startY;
                    alex.x = startEx.startX;
                    alex.y = startEx.startY;
                    Mouse.SetPosition(-1, -1);
                    ptsAroundBlock[2].X = -1;
                    ptsAroundBlock[2].Y = -1;
                    change = true;
                    shift = true;
                    exit = null;
                }
            }
            if (walkAround || walkAroundRightBlock || walkAroundUp)
            {
                if (ptsAroundBlock[2].X == -1)                          //only get it once... once mouse is clicked
                    ptsAroundBlock[2] = new Point(mouse.X, mouse.Y);

                if (!((alex.x >= curBlock.x && alex.x <= curBlock.x + curBlock.dimX && alex.y >= curBlock.y && alex.y <= curBlock.y + curBlock.dimY)))
                //if peer already passed the block... pra multiple ung maavoid nia 
                {
                    walkAround = false;
                    walkAroundRightBlock = false;
                    walkAroundUp = false;
                }

                if (ptsAroundBlock[0].X == -1 && ptsAroundBlock[1].X != -1) //if alex is not in the 2nd pt yet.
                {
                    if (!((alex.x - 5 <= ptsAroundBlock[1].X && alex.y - 5 <= ptsAroundBlock[1].Y) &&
                          (alex.x + 5 > ptsAroundBlock[1].X && alex.y + 5 > ptsAroundBlock[1].Y)))
                    {
                        mouse.X = ptsAroundBlock[1].X;
                        mouse.Y = ptsAroundBlock[1].Y;
                    }
                    if ((alex.x - 5 <= ptsAroundBlock[1].X && alex.y - 5 <= ptsAroundBlock[1].Y) &&
                                                 (alex.x + 5 > ptsAroundBlock[1].X && alex.y + 5 > ptsAroundBlock[1].Y))
                    {
                        ptsAroundBlock[1].X = -1;
                        mouse.X = ptsAroundBlock[2].X;
                        mouse.Y = ptsAroundBlock[2].Y;
                    }

                }
                if (ptsAroundBlock[0].X != -1)                  //if alex is not in the first pt yet.
                {
                    if (!((alex.x - 5 <= ptsAroundBlock[0].X && alex.y - 5 <= ptsAroundBlock[0].Y) &&
                        (alex.x + 5 > ptsAroundBlock[0].X && alex.y + 5 > ptsAroundBlock[0].Y)))
                    {
                        mouse.X = ptsAroundBlock[0].X;
                        mouse.Y = ptsAroundBlock[0].Y;
                        ptsAroundBlock[0].X = -1;
                    }

                }
            }
            m = Mouse.GetState();
          
        }
        private void processPlayerMove()                                                                    //moving of player to 4 directions
        {

            if (walkAroundRightBlock)
            {
                flip = false;
            }
            else
            {
                if (oldMainBlock != -1)
                {
                    if (mainBlocks[oldMainBlock].dimX <= mainBlocks[curMainBlock].dimX)
                        flip = true;
                    else if (mainBlocks[oldMainBlock].dimY < mainBlocks[curMainBlock].dimY)
                        flip = false;

                    //if (exit != null)
                    //{
                    //    if (mainBlocks[oldMainBlock].dimX <= exit.dimX)
                    //        flip = true;
                    //    else if (mainBlocks[oldMainBlock].dimY < exit.dimY)
                    //        flip = false;
                    //}

                    if (alex.x <= mainBlocks[oldMainBlock].x)
                        flip = !flip;
                    else if (alex.x > mainBlocks[oldMainBlock].x + mainBlocks[oldMainBlock].dimX)
                        flip = !flip;

                    if (alex.y <= mainBlocks[oldMainBlock].y)
                        flip = !flip;
                    else if (alex.y > mainBlocks[oldMainBlock].y + mainBlocks[oldMainBlock].dimY)
                        flip = !flip;
                }
            }
            if (!flip)
            {
                if (mouse.X > alex.x - 4 && mouse.X > alex.x + 4)
                {
                    alex.x = alex.x + 3;
                    alex.setCur(3);

                }
                else if (mouse.X < alex.x - 4 && mouse.X < alex.x + 4)
                {
                    alex.x = alex.x - 3;
                    alex.setCur(1);
                }
                else if (mouse.Y >= alex.y - 4 && mouse.Y >= alex.y + 4)
                {
                    alex.y = alex.y + 3;
                    alex.setCur(2);
                }

                else if (mouse.Y < alex.y - 4 && mouse.Y < alex.y + 4)
                {
                    alex.y = alex.y - 3;
                    alex.setCur(0);
                }
                else
                {
                    alex.setCur(4);                 //default stand
                }
            }
            else
            {
                if (mouse.Y >= alex.y - 4 && mouse.Y >= alex.y + 4)
                {
                    alex.y = alex.y + 3;
                    alex.setCur(2);
                    isPeerInGoal = false;
                }

                else if (mouse.Y < alex.y - 4 && mouse.Y < alex.y + 4)
                {
                    alex.y = alex.y - 3;
                    alex.setCur(0);
                    isPeerInGoal = false;
                }
                else if (mouse.X > alex.x - 4 && mouse.X > alex.x + 4)
                {
                    alex.x = alex.x + 3;
                    alex.setCur(3);
                    isPeerInGoal = false;
                }
                else if (mouse.X < alex.x - 4 && mouse.X < alex.x + 4)
                {
                    alex.x = alex.x - 3;
                    alex.setCur(1);
                    isPeerInGoal = false;
                }

                else
                {
                    alex.setCur(4);                 //default stand
                    isPeerInGoal = true;
                }
            }
        }
        public void Stop()
        {
            alex.setCur(4);                 //default stand
            isPeerInGoal = true;
            stop = true;

        }
        public void disableMouse()
        {
            stop = true;
        }
        public void Go()
        {
            stop = false;
        }
        private void intersect()
        {
            if (m.LeftButton == ButtonState.Pressed)
            {
                curChar = null;
                curItem = null;
            }

            //if (mouse.X >= alex.x - 5 && mouse.X < alex.x + 5 && mouse.Y >= alex.y - 5 && mouse.Y < alex.y - 5)
            //    isPeerInGoal = true;
            //else
            //    isPeerInGoal = false;

            if (isPeerInGoal)
            {
                if (curChar != null)
                {
                    peerCanWalk = false;
                    diaV.listDialogue = describer.getItemDescription(curChar.name, describer.NPCTYPE);
                    diaV.modifyListDialogue();
                    diaV.isShowing = true;
                    diaV.char2Pic = Content.Load<Texture2D>(curChar.bigSrc);

                    curChar = null;
                }
                if (curItem != null)
                {
                    peerCanWalk = false;
                    ItemPlanner ip = new ItemPlanner(diaV, sp, listInventory);
                    ip.renderItemDescription(curItem.name);

                    //items.Remove(curItem); 
                    curItem = null;
                }
            }
        }
        public void Update(GameTime gameTime)
        {
            if (invShowing)
            {
                if (m.Y <= 130)
                {
                    if (peerCanWalk)
                    {
                        if (!stop)
                            processMouse();
                    }
                }
            }
            if (!invShowing && peerCanWalk)
                if (!stop)
                    processMouse();

            if (shift)
            {

                mainBlocks = nCtr.getAllMainBlocks(curPlace);
                blocks = nCtr.getAllBlocks(curPlace);
                upSideBlocks = nCtr.getAllUpSideBlocks(curPlace);
                rightSideBlocks = nCtr.getAllRightSideBlocks(curPlace);

                //foreach(Exit ex in exCtr.getExits(curPlace)){
                //    nav = new Navigation(); 
                //    nav.dimX =ex.dimX;
                //    nav.dimY = ex.dimY;
                //    nav.type = "Exit";
                //    nav.x =ex.endX;
                //    nav.y = ex.endY;
                //    mainBlocks.Add(nav);
                //}
                mouse.X = alex.x;
                mouse.Y = alex.y;
                shift = false;
            }
            if (mainBlocks.Count > 0)
                processPlayerMove();
            intersect();

        }


        public void Draw(SpriteBatch spriteBatch)
        {
            int i = 0;
            //foreach(Navigation nav in mainBlocks)
            //{
                //spriteBatch.Draw(alex.getCur()[0], new Rectangle(nav.x, nav.y,nav.dimX, nav.dimY), Color.White);
                
            //}

            //spriteBatch.DrawString(Content.Load<SpriteFont>("calibri"), ptsAroundBlock[0].X + ":" + ptsAroundBlock[0].Y, new Vector2(100, 100), Color.Red);
            //spriteBatch.DrawString(Content.Load<SpriteFont>("calibri"), ptsAroundBlock[1].X + ":" + ptsAroundBlock[1].Y, new Vector2(100, 150), Color.Red);
            //spriteBatch.DrawString(Content.Load<SpriteFont>("calibri"), ptsAroundBlock[2].X + ":" + ptsAroundBlock[2].Y, new Vector2(100, 200), Color.Red);
            //spriteBatch.DrawString(Content.Load<SpriteFont>("calibri"),m.X + ":" + m.Y, new Vector2(50, 50), Color.Red);
            //spriteBatch.DrawString(Content.Load<SpriteFont>("calibri"),walkAroundUp+"", new Vector2(100, 200), Color.Red);
            //spriteBatch.DrawString(Content.Load<SpriteFont>("calibri"), str + "", new Vector2(100, 250), Color.Red);

            if (alex.getCur() != null)
            {
                if (alex.getCur().Length > 1)
                {
                    if (timer > 60)
                        timer = 0;

                    if (i < alex.getCur().Length)
                    {
                        if (timer % 10 == 0)
                            i++;
                    }
                    else
                        i = 0;
                    spriteBatch.Draw(alex.getCur()[i], new Rectangle(alex.x - 27, alex.y - 43, 54, 87), Color.White);

                    timer++;
                }
                else
                    spriteBatch.Draw(alex.getCur()[0], new Rectangle(alex.x - 27, alex.y - 43, 54, 87), Color.White);

            }

        }

        public void ChangePlace()
        {
            shift = true;

        }
        public bool didChangePlace()
        {
            return change;
        }
        public void setChangePlace(bool b)
        {
            change = b;
        }
        public int CurPlace
        {
            get { return curPlace; }
            set
            {
                shift = true;
                curPlace = value;
            }
        }

        public List<Character> Npcs
        {
            get { return npcs; }
            set { npcs = value; }
        }

        public List<Item> Items
        {
            get { return items; }
            set { items = value; }
        }

    }
}
